package ee.ttu.karileet.serviceshop.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import ee.ttu.karileet.serviceshop.dao.PersonDAO;
import ee.ttu.karileet.serviceshop.model.Person;
import ee.ttu.karileet.serviceshop.service.PersonService;


@Service("personService")
public class PersonServiceImpl implements PersonService {

	@Autowired
	private PersonDAO personDao;
	
	@Override
	@Transactional
	public void insertPerson(Person object) {
		personDao.insertPerson(object);
	}

	@Override
	@Transactional
	public List<Person> getPersons() {
		return personDao.getPersons();
	}

	@Override
	@Transactional
	public Person getPersonById(long id) {
		return personDao.getPersonById(id);
	}

}
